package com.example.tsproject.mapper;

import com.example.tsproject.entity.QuestionAndAssignment;
import com.example.tsproject.entity.QuestionDetails;
import com.example.tsproject.entity.Questions;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface QuestionsMapper extends BaseMapper<Questions> {

    List<Questions> selectQuestionsByTypeAndChapter(@Param("chapterRange") List<Integer> chapterRange,
                                                    @Param("singleChoiceLimit") int singleChoiceLimit,
                                                    @Param("tianKongTiLimit") int tianKongTiLimit,
                                                    @Param("trueFalseLimit") int trueFalseLimit);

    List<Questions> selectQuestionsByAssignmentId(@Param("assignmentId") Integer assignmentId);


    List<QuestionDetails> selectDetailedQuestionsByAssignmentIdAndStudentId(@Param("assignmentId") Integer assignmentId, @Param("studentId") String studentId);

    QuestionAndAssignment getQuestionByAssignmentQuestionId(Integer assignmentQuestionId,Integer assignmentId);
}
